home *** CD-ROM | disk | FTP | other *** search
- Garfield Benjamin (gbenjam@sosbbs.com) wrote:
-
- >AMOS currently allows you to use the If conditional in a structured
- >manner:
- > If AGE<10
- > Print "You are less than 10 years old."
- > End If
- > If AGE=21
- > Print "Hey!! Now you can drink alcohol in the U.S.!!"
- > End If
- > If AGE>21
- > Print "WOW, You're OVER 21!!!"
- > End If
-
- or
-
- > If AGE<10
- > Print "You are less than 10 years old."
- > Else
- > If AGE=21
- > Print "Hey!! Now you can drink alcohol in the U.S.!!"
- > Else
- > If AGE>21
- > Print "WOW, You're OVER 21!!!"
- > End If
- > End If
- > End If
-
- As a substitute for select...case I don't think either is good. They're both
- messy. Try this instead:
-
- If AGE<10
- Print "You are less than 10 years old."
- else if AGE=21
- print "Hey!! Now you can drink alcohol in the U.S.!!"
- else
- print "WOW, you're OVER 21!!"
- endif
-
- Smallest, and tidiest in my humble opinion.
-
- > Looks like AMOS needs support for those Select Cases as they
- > give the best of both worlds: clarity and maximum speed. :-)
-
- Is my approach good enough in the meantime? Hey, even old GFA-BASIC
- had select...case. It's quite handy at times since you could have like
- this for instance
-
- select age
-
- case 10,11-13,18
-
- Print "You're at an age where something exciting's going to happen to you"
-
- case 80
-
- Print "You're older than when most people die".
-
- ---
- Look at the shoes you're filling, look at the blood we're spilling
- Look at the world we're killing, the way we've always done before
- Look at the doubt we've wallowed, look at the leaders we've followed
- Look at the lies we've swallowed and I don't wanna hear no more
- ---
- Don't worry if it doesn't work right. If everything did, you'd be out of a job.
-
-
-